﻿package mortal.game.view.task.view
{
    import com.mui.controls.*;
    import flash.display.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.item.*;

    public class TaskRewardBaseItem extends GSprite
    {
        protected var _item:BaseItem;
        protected var _num:GTextFiled;

        public function TaskRewardBaseItem()
        {
            return;
        }// end function

        public function set tooltipData(param1) : void
        {
            if (this._item != null)
            {
                this._item.toolTipData = param1;
            }
            return;
        }// end function

        public function get tooltipData()
        {
            if (this._item != null)
            {
                return this._item.toolTipData;
            }
            return null;
        }// end function

        public function get bitmapdata() : BitmapData
        {
            if (this._item != null)
            {
                return this._item.bitmapdata;
            }
            return new BitmapData(1, 1);
        }// end function

        public function setData(param1, param2:int, param3:String = null) : void
        {
            if (param1 is ItemData)
            {
                this._item.itemData = param1;
                this._item.isShowToolTip = true;
            }
            else if (param1 is int)
            {
                this._item.itemCode = int(param1);
                this._item.isShowToolTip = true;
            }
            else
            {
                this._item.source = param1;
                this._item.isShowToolTip = false;
            }
            var _loc_4:String = "x";
            if (param3 != null)
            {
                _loc_4 = param3 + "x";
            }
            if (param2 < 0)
            {
                this._num.text = "";
            }
            else if (param2 > 10000)
            {
                this._num.text = _loc_4 + int(param2 / 10000).toString() + "w";
            }
            else
            {
                this._num.text = _loc_4 + int(param2).toString();
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._item.dispose(param1);
            this._num.dispose(param1);
            this._item = null;
            this._num = null;
            return;
        }// end function

    }
}
